<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.hilaver.dzmis.Constants"%>
<%@ page import="com.hilaver.dzmis.service.impl.CtServiceImpl"%>
<%@ page import="com.hilaver.dzmis.service.impl.ProcurementServiceImpl"%>
<%@ page import="com.hilaver.dzmis.service.impl.I18nServiceImpl"%>
<%@ page import="com.hilaver.dzmis.codetable.*"%>
<%@ page import="com.hilaver.dzmis.procurement.Procurement"%>
<%@ page import="com.hilaver.dzmis.product.ProductIdentification"%>
<%@ page import="com.hilaver.dzmis.product.ProductAccessoryOthers"%>
<%
	Integer id = Integer.parseInt(request.getParameter("id"));
	CtServiceImpl cs = new CtServiceImpl();
	ProcurementServiceImpl ps = new ProcurementServiceImpl();
	I18nServiceImpl i18n = new I18nServiceImpl();
	Locale locale = (Locale) request.getSession().getAttribute(
			Constants.SESSION_LOCALE);
	ps.setLocale(locale);
	Procurement procurement = ps.getObj(id);
	Set<ProductIdentification> piSet = procurement
			.getProductIndentifications();
	List<ProductAccessoryOthers> paoList = ps.getProductCardboardFrom(piSet);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 
<link rel="stylesheet" type="text/css" href="../../styles/dzbase.css" />
<title><%=procurement.getName()%>--<%=i18n.getShortMessage(locale, "ui.procurement.cardboard") %></title>
</head>
<body>
<table cellspacing="0" id="the-table" style="width: 100%;float: left;">
	<tr>
		<td style="background:#eeeeee;text-align: center;" colspan="3">
			<b><%=procurement.getName() %>&nbsp;&nbsp;<%=i18n.getShortMessage(locale, "ui.procurement.cardboard") %></b>
		</td>
	</tr>
	<tr style="background:#eeeeee;">
		<td style="text-align: center;">
			<b><%=i18n.getShortMessage(locale, "ui.reference.reference") %></b>
		</td>
		<td style="text-align: center;">
			<b><%=i18n.getShortMessage(locale, "message.edit.collar") %></b>
		</td>
		<td style="text-align: center;">
			<b><%=i18n.getShortMessage(locale, "message.list.total") %></b>
		</td>
	</tr>
	<%for(ProductAccessoryOthers pao : paoList){ %>
		<tr>
			<td style="text-align: center;">
				<%=pao.getProductIdentification().getReference() %>
			</td>
			<td style="text-align: center;">
				<%=cs.getDescription(CtCollarType.class.getName(), pao.getProductIdentification().getCtCollarType(), locale) %>
			</td>
			<td style="text-align: center;" class="x-grid3-td-total">
				<%=pao.getTotal() %>
			</td>
		</tr>
	<%} %>
	<tr>
		<td style="text-align: right;" colspan="2">
			<b><%=i18n.getShortMessage(locale, "message.list.total") %></b>&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
		<td style="text-align: center;" class="x-grid3-total">
			<%=ps.getCarboardTotal(paoList) %>
		</td>
	</tr>
</table>
</body>
</html>